from abc import ABC, abstractmethod
from typing import Dict, Any

class IEventFilter(ABC):
    """事件过滤器接口"""
    
    @abstractmethod
    def filter(self, event: Any) -> bool:
        """过滤事件"""
        pass

class IEventPriority(ABC):
    """事件优先级接口"""
    
    @abstractmethod
    def get_priority(self) -> int:
        """获取事件优先级"""
        pass

class IModuleLifecycle(ABC):
    """模块生命周期管理接口"""
    
    @abstractmethod
    def initialize(self) -> None:
        """初始化模块"""
        pass
    
    @abstractmethod
    def shutdown(self) -> None:
        """关闭模块"""
        pass

class IHotSwap(ABC):
    """模块热插拔接口"""
    
    @abstractmethod
    def can_hot_swap(self) -> bool:
        """判断模块是否支持热插拔"""
        pass
    
    @abstractmethod
    def swap(self, new_impl: Any) -> None:
        """热插拔新实现"""
        pass

# 保留原有接口
class IRiskManager(ABC):
    """风险控制管理接口"""
    
    @abstractmethod
    def validate_signals(self, signals) -> bool:
        """验证交易信号是否合规"""
        pass

    @abstractmethod
    def update_risk_params(self, max_position: float, max_loss: float) -> None:
        """更新风险控制参数"""
        pass

class IDataProvider(ABC):
    """数据提供接口"""
    
    @abstractmethod
    def get_market_data(self, symbol: str):
        """获取市场数据"""
        pass

class IStrategy(ABC):
    """策略接口"""
    
    @abstractmethod
    def generate_signals(self, data):
        """生成交易信号"""
        pass